#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	int n;
	while(1){
		scanf("%d",&n);
		if(n==0)
		break;
		int num;
		num = cows_count(n);
		printf("%d\n",num);
	}
	return 0;
}
cows_count(int n){
	if(n<=3)
	return 0;
	else{
		
	}
}




